//-------------------------------------------------------------------
//	Copyright (c) 2010-2012 Zhirnov Andrey
//	This file is part of the "UXGEN" project.
//	See copyright notice in "Engine.h".
//-------------------------------------------------------------------

#ifndef _UX_POINTERS_H
#define _UX_POINTERS_H

#include "AllTypes.h"
#include "BaseObject.h"

namespace Engine
{

#define AUTO_POINTER( _name ) \
	typedef TAutoPtr< _name, CEngBaseObject, TAutoPtrStrategy< CEngBaseObject > >	_name##Ptr;



namespace UXTypes
{
	
	template <>
	struct TAutoPtrStrategy< CEngBaseObject >
	{
		static void Delete(CEngBaseObject *ptr)	{ ptr->Release(); }
	};

}	// UXTypes

namespace RenderUtils
{
	class IDefaultMaterial;
	
	REFERENCED_POINTER( IDefaultMaterial );

}	// RenderUtils

namespace GUI
{
	REFERENCED_POINTER( CScreen );

}	// GUI

namespace Resources
{

	// textures
	class CTexture;
	class CTexture2D;
	class CTexture2DArray;
	class CTexture2DMS;
	class CTexture2DMSArray;
	class CTexture3D;
	class CTextureCube;
	class CTextureCubeArray;
	class CTextureBuffer;
	class CBitmapFont;
	class CSprite;
	class CSprite2DAnimation;
	class CSpriteAnimation;
	class CVideoTexture;

	// programs
	class IProgram;
	class CProgram;

	// materials
	class IMaterial;
	class IMaterialLayer;
	class CMaterial;
	//class CMaterialLayer;

	// post processes
	class IPostProcess;
	class IPostProcessBase;

	// meshes
	class CMultiMesh;
	class CSceletalMesh;

	// animations
	class IBaseAnimation;
	class CFrameAnimation;
	class CMorphingAnimation;
	class CSceletalAnimation;
	class CTransformAnimation;

	// models
	class CMultiMeshModel;
	//class COctreeMeshModel;
	//class CPortalMeshModel;

	// model animators
	class IBaseModelAnimator;
	class CFrameAnimAnimator;
	class CMorphingModelAnimator;
	class CSceletalModelAnimator;
	class CTransformModelAnimator;

	// sounds
	class CSound;
	class CSoundBuffer;
	class CMusic;

	// terrain
	//class CTerrain;
	//class CMegaTexture;
	//class ITerrainUpdater;
	//class CWater;


	//REFERENCED_POINTER( CResource );	// use IResourcePtr
	
	// textures
	REFERENCED_POINTER( CTexture );
	REFERENCED_POINTER( CTexture2D );
	REFERENCED_POINTER( CTexture2DArray );
	REFERENCED_POINTER( CTexture2DMS );
	REFERENCED_POINTER( CTexture2DMSArray );
	REFERENCED_POINTER( CTexture3D );
	REFERENCED_POINTER( CTextureCube );
	REFERENCED_POINTER( CTextureCubeArray );
	REFERENCED_POINTER( CTextureBuffer );
	REFERENCED_POINTER( CBitmapFont );
	REFERENCED_POINTER( CSprite );
	AUTO_POINTER(		CSprite2DAnimation );
	REFERENCED_POINTER( CVideoTexture );
	
	// sounds
	REFERENCED_POINTER( CMusic );
	REFERENCED_POINTER( CSound );
	REFERENCED_POINTER( CSoundBuffer );
	
	// meshes
	REFERENCED_POINTER( CMultiMesh );
	REFERENCED_POINTER( CSceletalMesh );

	// models
	REFERENCED_POINTER( CMultiMeshModel );

	// model animators
	/*REFERENCED_POINTER( IBaseModelAnimator );
	REFERENCED_POINTER( CFrameAnimAnimator );
	REFERENCED_POINTER( CMorphingModelAnimator );
	REFERENCED_POINTER( CSceletalModelAnimator );
	REFERENCED_POINTER( CTransformModelAnimator );*/

	// animations
	/*REFERENCED_POINTER( IBaseAnimation );
	REFERENCED_POINTER( CFrameAnimation );
	REFERENCED_POINTER( CMorphingAnimation );
	REFERENCED_POINTER( CSceletalAnimation );
	REFERENCED_POINTER( CTransformAnimation );*/

	// terrain
	//REFERENCED_POINTER( CTerrain );
	//REFERENCED_POINTER( CWater );
	//REFCOUNTABLE_POINTER( ITerrainUpdater );
	
	// programs
	REFERENCED_POINTER( IProgram );
	REFERENCED_POINTER( CProgram );

	// materials
	REFERENCED_POINTER( IMaterial );
	REFERENCED_POINTER( CMaterial );

	
	// post processes
	REFERENCED_POINTER( IPostProcessBase );
	AUTO_POINTER(		IPostProcess );
	
	
#undef  AUTO_POINTER

//-------------------------------------------------------------------
	
}	// Resources
}	// Engine

#endif	// _UX_POINTERS_H